<template>
	<view>
		<!--  <view class="top">
     设置
    
     <span class="goBack" @click="goBack"></span>
   
   </view> -->
		<!--  -->
		<view class="bottom-bot" style="margin-top: 50upx;">
			<view class="bottom-address address-info" style=" border-bottom: 1px solid #eee;">
				<span class="name">姓名：</span>
				<span class="address">{{userName}}</span>
			</view>
			<view class="bottom-address address-info" style=" border-bottom: 1px solid #eee;">
				<span class="name">公司：</span>
				<span class="address">{{companyFullName}}</span>
			</view>
			<view class="bottom-address address-info">
				<span class="name">职位：</span>
				<span class="address">{{postName}}</span>
				<!-- <span style="color: #1752DB;">028-85196649</span> -->
			</view>
			<view class="bottom-address address-info" style=" border-bottom: 1px solid #eee;">
				<span class="name">公司级别：</span>
				<span class="address">{{companyNature}}</span>
			</view>
			<view class="bottom-address address-info" style=" border-bottom: 1px solid #eee;">
				<span class="name">项目名称：</span>
				<span class="address">{{projectName}}</span>
			</view>
		</view>
		<view class="bottom">
			<view class="mine-bottom">
				<h3 @click="outLogin('1')" style="font-size:16px;">切换账号</h3>
				<h3 @click="outLogin('0')" style="font-size:16px">退出登录</h3>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				show: false,
				newpassword: "",
				oldpassword: "",
				surepassword: "",
				companyFullName: "",
				userName: "",
				postName: "",
				companyNature: "",
				projectName: "",
			};
		},
		onLoad() {
			this.getData()
		},
		methods: {
			getData() {
				var userInfo = {}
				var that = this
				uni.getStorage({
					key: 'userInfo',
					success: function(res) {
						userInfo = JSON.parse(res.data)
						// console.log(userInfo)
						that.userName = userInfo.realName
						that.companyFullName = userInfo.companyFullName
						that.postName = userInfo.postName
						that.companyNature = userInfo.companyNature
						that.projectName = userInfo.projectName
						// 
						// 
						// 
					}
				})
			},
			// 跳转到我的页面
			goBack() {

				uni.navigateBack()

			},
			showPopupp() {
				this.show = true;
			},
			onSubmit(values) {
				// console.log("submit", values);
			},
			// 退出登录
			outLogin(num) {
				// #ifdef APP-PLUS

				var tip = "";
				if (num == 0) {
					tip = "您确定要退出当前账号吗？";

				}
				if (num == 1) {
					tip = "您确定要切换当前账号吗？";
				}
				uni.showModal({
					title: '提示',
					content: tip,
					success: function(res) {
						if (res.confirm) {
							// console.log('用户点击确定');
							uni.navigateTo({
								url: '/pages/index/index'
							});
						} else if (res.cancel) {
							// console.log('用户点击取消');
						}
					}
				});
				// #endif
				// #ifdef H5
				// uni.showToast({
				// 	title: "暂无权限",
				// 	icon: 'none',
				// 	duration: 2000
				// });
				
				var tip = "";
				if (num == 0) {
					tip = "您确定要退出当前账号吗？";
				
				}
				if (num == 1) {
					tip = "您确定要切换当前账号吗？";
				}
				uni.showModal({
					title: '提示',
					content: tip,
					success: function(res) {
						if (res.confirm) {
							// console.log('用户点击确定');
							uni.navigateTo({
								url: '/pages/index/indexWx'
							});
						} else if (res.cancel) {
							// console.log('用户点击取消');
						}
					}
				});
				// #endif


			},
		}
	};
</script>
<style scope>
	.bottom-bot {
		padding: 1rem;
		background: white;
	}

	.bottomer {
		margin: 0;
	}

	.mine-bottom {
		text-align: center;
		margin-top: 20px;
		background: white;
	}

	.mine-bottom h3 {
		margin: 0;
		padding: 0;
		line-height: 60px;

		/* padding: 0.7rem 0; */
		font-weight: 400;
		/* margin: 0; */
	}

	.mine-bottom h3 {
		border-bottom: 1px solid #eee;
	}

	.name {
		width: 200upx;
		font-size: 32upx;
	}

	.address {
		font-size: 32upx;
		padding-left: 20upx;
	}

	.bottom-address {
		padding: 20upx 0;
	}

	.address-info {
		display: flex;

	}

	.address-info .name {

		width: 33%;
		display: inline-block;
		text-align-last: justify;
		font-weight: 700;
	}
</style>
